<?php
//Our hook
add_shortcode('image_slider', 'dt_shortcode_showcase_slider');
add_shortcode('slide', 'dt_shortcode_showcase_slide');

function dt_shortcode_showcase_slider( $atts, $content = null ) {
    extract( shortcode_atts( array(
        'size'  => 'half'
    ), $atts));
    
    switch( $size ) {
        case 'full':
            $class = 'custom-full';
            break;
        
        default:
            $class = 'custom';
    }
    
    return '<div id="showcase" class="showcase ' . $class . '">' . do_shortcode(trim(str_replace("\r\n", '', $content))) . '</div>';
}

function dt_shortcode_showcase_slide( $atts, $content = null ) {
    extract( shortcode_atts( array(
        'alt'       => '',
        'title'     => '',
        'height'    => '',
        'size'      => 'half'
    ), $atts));
    
    if( !$content ) {
        return '';
    }
    
    switch( $size ) {
        case 'full':
            $width = '930';
            break;
        
        default:
            $width = '590';
    } 
    
    if( $height ) {
        $height = ' height="' . $height . '"';
    }
    
    if( $title ) {
        $title = '<div class="showcase-caption">' . esc_html($title) . '</div>';
    }
    
    return '<div class="showcase-slide"><div class="showcase-content"><img src="' . esc_attr(trim($content)) . '"' . $height . ' width="' . $width . '" alt="' . esc_attr($alt) . '"/></div>' . $title . '</div>';				
}

// Call it now
$tinymce_button = new dt_add_mce_button(
    'dt_mce_plugin_shortcode_slider',
    'slider',
    false
);
?>